const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
  entry: './src/index.js',
  plugins:[
    new HtmlWebpackPlugin({
      template:'dist/index.html',
      filename:'index.html'
    })
  ],
  devServer:{
    contentBase:path.join(__dirname,'dist'),
  },
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  module:{
  	rules:[
  		{
  			test:/\.css$/,
  			use:[
  				'style-loader',
  				'css-loader'
  			]
  		},
  		{
  			test:/\.(png|svg|jpg|gif)$/,
  			use:[
  				'file-loader'
  			]
  		}
  	]
  }
};